package com.example.demo.test;

import com.example.demo.entity.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    // 覆盖接口
    @GetMapping("/api/users/{id}")
    public User findUserById(@PathVariable Long id) {
        final User user = new User();
        user.id = id;
        user.name = "overwrite";
        user.password = "overwrite";
        user.age = 0;
        user.email = "overwrite";
        user.isAdmin = false;
        return user;
    }

}
